<template>
  <view class="content1">
  	<view class="page-head">
  		<uni-icons class="gap-top" type="arrow-left" color="white" size="30" @click="goBack"></uni-icons>
  		<text class="white-font gap-top">{{type}}</text>
  	</view>
    <rich-text :nodes="protocol.content"></rich-text>
  </view>
</template>

<script>
import { loadProtocol } from '@/api/protocol';
import {onLoad} from "@dcloudio/uni-app";

export default {
  name: "index",
  data() {
    return {
      protocol: {},
	  type:""
    }
  },
  onLoad: async function(options) {
    const type = options.type || ''
    if (!type) {
      uni.showToast({
        title: 'type参数错误',
        icon: 'none'
      })
      return
    }
	this.type = options.type 
    const params = {
      type: type
    }
    const res = await loadProtocol(params)
    const data = res.data || {}
    const protocol = data.protocol || {}
    this.protocol = protocol
  },
  onShow: async function () {
    console.log('-----onShow')
  },
  methods:{
	  goBack() {
	  	uni.navigateBack({
	  		delta: 1,
	  	});
	  }
  }
}
</script>

<style scoped lang="scss">
	@import "src/static/scss/common";
	
	.package-box {
		background-color: #0a050b;
	}
	.container {
		padding-top: var(--status-bar-height,20px);
	}
</style>
